<ui:composition template="/resources/templates/table.xhtml"
                xmlns="http://www.w3.org/1999/xhtml"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:ui="http://java.sun.com/jsf/facelets">

    <ui:define name="table-header">
        <h:outputText value="#{msgs['table.terms']}" styleClass="table_name"/>
    </ui:define>

    <ui:define name="button-menu-top">
        <div>
            <h:button outcome="/content/addTermPage" title="#{msgs['add']}" value="#{msgs['add']}" styleClass="margin2ptb"/>
            <input type="button" title="#{msgs['edit']}" value="#{msgs['edit']}" class="margin2ptb"/>
            <input type="button" title="#{msgs['delete']}" value="#{msgs['delete']}" class="margin2ptb"/>
        </div>
    </ui:define>

    <ui:define name="table-content">
        <div class="table_wrapper">
            <div>
                <div>
                    <div style="width: 100%;">
                        <table border="0" cellspacing="0" cellpadding="0" class="table_data">
                            <thead>
                            <tr>
                                <th class="th_data_first"></th>
                                <th class="th_data">#{msgs['dictionary']}</th>
                                <th class="th_data">#{msgs['code']}</th>
                                <th class="th_data">#{msgs['value']}</th>
                                <th class="th_data">#{msgs['description']}</th>
                            </tr>
                            </thead>
                            <ui:repeat value="#{termsTableBean.pagebleTerms}" var="term" varStatus="termindex">
                                <tr class="#{termindex.even ? 'even' : 'odd'}">
                                    <td class="td_data_first">#{term.id}</td>
                                    <td class="td_data">#{term.dictionary != null ? term.dictionary.code : ''}</td>
                                    <td class="td_data">#{term.code}</td>
                                    <td class="td_data">#{term.value}</td>
                                    <td class="td_data">#{term.description}</td>
                                </tr>
                            </ui:repeat>
                        </table>
                    </div>
                </div>
            </div>
            <ui:include src="/resources/includes/pagination.xhtml">
                <ui:param name="paginationBean" value="#{termsTableBean}"/>
            </ui:include>
        </div>
    </ui:define>

    <ui:define name="button-menu-bottom">
        <div>
            <h:button outcome="/content/addTermPage" title="#{msgs['add']}" value="#{msgs['add']}" styleClass="margin2ptb"/>
            <input type="button" title="#{msgs['edit']}" value="#{msgs['edit']}" class="margin2ptb"/>
            <input type="button" title="#{msgs['delete']}" value="#{msgs['delete']}" class="margin2ptb"/>
        </div>
    </ui:define>

</ui:composition>